package data.nanjing.expo.models.dao;

import data.nanjing.expo.models.domain.ActivityInfo;
import data.nanjing.expo.models.domain.ActivityInfoDetail;
import data.nanjing.expo.models.domain.dto.ActivityInfoDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component
public interface ActivityInfoDao {

    //最近活动
    public List<ActivityInfo> selectLatestActivityInfoList();

    //活动筛选
    public List<ActivityInfo> selectActivityInfoList(@Param("industry") String industry, @Param("isFree") String fee,
                                                       @Param("datetime") Date time, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);

    //活动详情
    public ActivityInfoDto selectActivityDetailInfoById(@Param("id") Integer id);

    //活动推荐
    public List<ActivityInfo> selectRecommendActivity();


    //首页热门活动(实质:由管理员设置哪些活动可以在首页展示)
    public List<ActivityInfo> selectHotActivityList();

    //根据用户Id查询正在进行的活动列表
    public List<ActivityInfo> selectWorkActivityListByUserId(@Param("userId") Integer userId,
                                                             @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);

    //根据用户Id查询已经结束的活动列表
    public List<ActivityInfo> selectEndActivityListByUserId(@Param("userId") Integer userId,
                                                            @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);

    //添加活动(主表内容)
    public Integer addActivityInfo(ActivityInfo activityInfo);

    //添加活动详细内容
    public Integer addActivityDetailInfo(ActivityInfoDetail activityInfoDetail);

    //修改活动(主表内容)
    public void updateActivityInfo(ActivityInfo activityInfo);

    //修改活动(详细)
    public void updateActivityDetail(ActivityInfoDetail activityInfoDetail);

    //删除活动(假删除)
    public void deleteActivityById(@Param("activityId") Integer activityId);

    //更新活动状态
    public void updateActivityStatus(@Param("activityId") Integer activityId, @Param("status") String status);

    //活动报名人数+1
    public void addActivityApplyNumber(@Param("id") Integer id);

    //活动收藏人数-1
    public void addActivityFavoriteNumber(@Param("id") Integer id);

    //活动报名人数-1
    public void increaseActivityApplyNumber(@Param("id") Integer id);

    //活动收藏人数-1
    public void increaseActivityFavoriteNumber(@Param("id") Integer id);

    public ActivityInfo selectActivityInfoById(@Param("activityId") Integer activityId);

    public Integer selectWorkActivityCountByUserId(@Param("userId") Integer userId);

    public Integer selectEndActivityCountByUserId(@Param("userId") Integer userId);

}
